﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Offers.aspx.cs" Inherits="TouristAgency._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Welcome to My Tour Agency
    </h2>
    <p>
        <asp:GridView ID="GridView2" runat="server" 
            AutoGenerateColumns="False"  
            DataSourceID="ToursDataSource" DataKeyNames="TourID"
            AutoGenerateEditButton="false" 
            OnRowEditing="GridView2_OnRowEditing" 
            OnRowUpdating="GridView2_OnRowUpdating" >
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:Button runat="server" ID="ButtonEditTour" CommandName="Edit" Text="Edity" />
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:Button runat="server" ID="ButtonEditTour1212" CommandName="Update" Text="Save" />
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="StartDate" HeaderText="StartDate" ReadOnly="True" 
                    SortExpression="StartDate" />
                <asp:BoundField DataField="EndDate" HeaderText="EndDate" ReadOnly="True" 
                    SortExpression="EndDate" />
                <asp:BoundField DataField="Price" HeaderText="Price" ReadOnly="True" 
                    SortExpression="Price" />
                <asp:BoundField DataField="Description" HeaderText="Description" 
                    ReadOnly="True" SortExpression="Description" />               

                <asp:TemplateField HeaderText="Transportation" >
                    <ItemTemplate>
                        <asp:Label runat="server" Text='<%# Eval("TransportationID") %>' ID="asdsadsa" />
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox runat="server" Text='<%# Bind("TransportationID") %>' ID="asdsadsa1312" />
                    </EditItemTemplate>
                </asp:TemplateField>                
            </Columns>
        </asp:GridView>
        <asp:EntityDataSource ID="ToursDataSource" runat="server" 
            ConnectionString="name=TouristAgencyEntities" 
            DefaultContainerName="TouristAgencyEntities" 
            EnableFlattening="false" 
            EntitySetName="Tours"                       
            EnableUpdate="true">

        </asp:EntityDataSource>


    </p>
    <p>
        <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
            AutoGenerateColumns="False" DataKeyNames="TourID" 
            DataSourceID="TourNewEntityDataSource">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="TourID" HeaderText="TourID" ReadOnly="True" 
                    SortExpression="TourID" />
                <asp:BoundField DataField="StartDate" HeaderText="StartDate" 
                    SortExpression="StartDate" />
                <asp:BoundField DataField="EndDate" HeaderText="EndDate" 
                    SortExpression="EndDate" />
                <asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" />
                <asp:BoundField DataField="Description" HeaderText="Description" 
                    SortExpression="Description" />
                <asp:BoundField DataField="DestinationID" HeaderText="DestinationID" 
                    SortExpression="DestinationID" />
                <asp:BoundField DataField="FacilityID" HeaderText="FacilityID" 
                    SortExpression="FacilityID" />

                <asp:TemplateField HeaderText="Transportation" >
                    <ItemTemplate>
                        <asp:Label runat="server" Text='<%# Eval("TransportationID") %>' ID="asdsadsa" />
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox runat="server" Text='<%# Bind("TransportationID") %>' ID="asdsadsa1312" />
                    </EditItemTemplate>
                </asp:TemplateField>    
            </Columns>
        </asp:GridView>
        <asp:EntityDataSource ID="TourNewEntityDataSource" runat="server" 
            ConnectionString="name=TouristAgencyEntities" 
            DefaultContainerName="TouristAgencyEntities" EnableDelete="True" 
            EnableFlattening="False" EnableInsert="True" EnableUpdate="True" 
            EntitySetName="Tours">
        </asp:EntityDataSource>
    </p>
</asp:Content>
